package com.swh.cloud.biz.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.swh.cloud.biz.base.dao.BaseDaoImpl;
import com.swh.cloud.biz.dao.IUserDao;
import com.swh.user.domain.UserEntity;

@Repository
public class UserDao extends BaseDaoImpl<UserEntity> implements IUserDao {
	
	private static String NAMESPACE = "com.swh.cloud.biz.mybatis.UserEntityMapper" ;
	
//	@Autowired
//    private JdbcTemplate jdbcTemplate;
	
	 @Autowired
	 public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
	     // TODO Auto-generated method stub
	     super.setSqlSessionFactory(sqlSessionFactory);
	  }
	
	public UserDao() {
		super(NAMESPACE);
	}
	/**
	 * 通过联合查询 - 复合查询
	 * @author sangwenhao
	 * @date 2016年4月22日
	 */
	@Override
	public List<UserEntity> getUserByUnion(Map<String, UserEntity> paraMap) {
	    
	    return this.getSqlSession().selectList(NAMESPACE+".getUserByUnion", paraMap);
	}

	@Override
	public List<UserEntity> getUserByUnion2(Map<String, UserEntity> paraMap) {
		 return this.getSqlSession().selectList(NAMESPACE+".getUserByUnion2", paraMap);
	}
	
}
